import pandas as pd
from pyecharts import options as opts
from pyecharts.charts import Scatter
df = pd.read_excel('某店铺销售数据.xlsx')
scatter=Scatter(init_opts=opts.InitOpts(page_title='气泡图'))
scatter.add_xaxis(xaxis_data=df['商品价格（元）'])
scatter.add_yaxis(series_name='',
                  y_axis=df[['销售额（元）','利润率（%）']].values.tolist(),label_opts=opts.LabelOpts(is_show=False))
scatter.set_global_opts(
    title_opts=opts.TitleOpts(title='某店铺商品价格与销售额、利润率相关性气泡图',
    pos_left='center'),
    xaxis_opts=opts.AxisOpts(name='商品价格（元）',)
)